<?php

declare(strict_types=1);

namespace app\yperp\logic\ktt;

use app\yperp\model\GoodsSkuStandby;

class KttStep
{
    static public function docker_restart()
    {
        return [
            // ['type' => 'this', 'do' => ['this_method' => 'docker_restart'], 'sleep' => '3'],
            ///html/body/div/div/div[2]/div[1]/div/div[2]/div[2]/div/div/div/img
        ];
    }
    static public function login_page()
    {
        return [ // 二维码图片
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div/div/div[2]/div[1]/div/div[2]/div[2]/div/div/div/img'], 'sleep' => '3'],



            //点击 商品库 菜单
            ['title' => '点击 商品库 菜单', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div/div[1]/div/ul/li[3]/span'], 'sleep' => '3'],
            //点击 手动创建商品 菜单
            ['title' => '点击 手动创建商品 菜单', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div/div[2]/div[2]/section/section[1]/div/div[1]/div[2]/div/button[1]'], 'sleep' => '3'],
            // 输入商品名称 
            ['title' => '输入商品名称', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div/div[2]/div[2]/section/section[1]/div/div/div/div[2]/form/div[1]/div/div/div/div[2]/div/div/div/div/div/div/div[1]/input', 'option' => ['clear' => 'clear', 'sendKeys'  => '输入商品名称'],], 'sleep' => 3],

            [
                'title' => '显示上传按钮', 'type' => 'findElement', 'do' => [
                    'xpath' => '/html/body/div[1]/div[1]/div/div[2]/div[2]/section/section[1]/div/div/div/div[2]/form/div[3]/div/div/div/div[1]/div[2]/div/div/div/div/div/div/div/input',
                    'option' => ['script' => "arguments[0].setAttribute('style', 'display: block;')",],
                ], 'sleep' => 3
            ],

            [
                'title' => '上传商品头图', 'type' => 'findElement', 'do' => [
                    'xpath' => '/html/body/div[4]/div[1]/div/input[2]',
                    'option' => [
                        'uploadFiles' => '上传商品头图'
                    ],
                ], 'sleep' => 3
            ]
        ];
    }

    /**
     * 判断商品是否存在并修改状态
     */
    static function checkGoods($ids = [])
    {
        $array = array_merge([], self::login());
        // $array = array_merge($array, ChanghongList::list());
        $array = array_merge($array, self::nav(['有品超市', '有品生鲜', '蛋类']));
        foreach ($ids as $key => $id) {
            # code...
            $info  = GoodsSkuStandby::where(['id' => $id])->find();
            $array_check = [

                ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[1]/div/div[3]/div/div/table/tbody/tr/td[1]/input', 'option' => 'click'],],
                [
                    'title' => '搜索物料编码',
                    'type' => 'findElement', 'do' => [
                        'xpath' => '/html/body/div[1]/div[1]/div[1]/div/div[3]/div/div/table/tbody/tr/td[1]/input',
                        'option' => ['sendKeys' => $info['itemCodeAlias'],]
                    ],
                    'sleep' => 1
                ],
                ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[1]/div/div[3]/div/div/table/tbody/tr/td[2]/div', 'option' => 'click'], 'sleep' => 3],

                [
                    'title' => '判断物料编码是否存在',
                    'type' => 'checkIsset',
                    'do' =>  [
                        'xpath' => '/html/body/div[1]/div[1]/div[2]/div[1]/table/tbody[2]/tr/td',
                        'func' => 'checkAttrClassName',
                        'true' => [
                            ['type' => 'class', 'do' => ['className' =>  'app\yperp\model\GoodsSkuStandby', 'func' => 'status', 'args' => [$info['id'], 2]]],
                            ['type' => 'log', 'do' => '商品已经存在'],
                        ],
                        'false' => [
                            ['type' => 'class', 'do' => ['className' =>  'app\yperp\model\GoodsSkuStandby', 'func' => 'status', 'args' => [$info['id'], 1]]],
                            ['type' => 'log', 'do' => '商品不存在'],

                        ]
                    ]

                ],

            ];
            $array = array_merge($array, $array_check);
        }

        return $array;
    }



    static public function login()
    {
        return [
            ['type' => 'this', 'do' => ['this_method' => 'docker_check']],
            ['type' => 'this', 'do' => ['this_method' => 'docker_restart', 'fastrun' => true], 'sleep' => '3'],
            ['type' => 'this', 'do' => ['this_method' => 'newWebDriver', 'fastrun' => true],  'sleep' => 3],
            ['type' => 'this', 'do' => ['this_method' => 'run_login'], 'sleep' => 3],
        ];
    }

    static public function checklogin()
    {
        return [
            ['type' => 'this', 'do' => ['this_method' => 'run_login'], 'sleep' => '3'],
        ];
    }

    static public function list()
    {
        return [
            ['type' => 'frame', 'do' => ['option' => 'inframe', 'xpath'  => '/html/body/div[8]/div[2]/div[1]/div[2]/iframe'], 'sleep' => 1],
            ['type' => 'findElement',   'do' => ['option' => 'click', 'xpath' => '/html/body/div/div[2]/div/div[4]/a',], 'sleep' => 1],
            ['type' => 'frame', 'do' => ['option' => 'outframe',], 'sleep' => 3],
            ['type' => 'frame', 'do' => ['option' => 'inframe', 'xpath' => '/html/body/div[8]/div[2]/div[3]/iframe'], 'sleep' => 1],
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[2]/div[2]/div/div[1]', 'option' => 'doubleClick'], 'sleep' => 1],
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[2]/div[2]/div/div[1]', 'option' => 'doubleClick'], 'sleep' => 1],
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[2]/div[2]/div/div[1]', 'option' => 'doubleClick'], 'sleep' => 1],
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[2]/div[2]/div[2]/div[1]', 'option' => 'doubleClick']],
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[2]/div[2]/div[2]/div[1]', 'option' => 'doubleClick']],
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[3]/table/tbody/tr/td[1]', 'option' => 'doubleClick']],
        ];
    }


    static public function nav($navs = [])
    {
        $step[] =  ['type' => 'frame', 'do' => ['option' => 'inframe', 'xpath'  => '/html/body/div[8]/div[2]/div[1]/div[2]/iframe'], 'sleep' => 1];

        $step[] = ['type' => 'findElement',   'do' => ['option' => 'click', 'cssSelector' => 'div[title="资源库"]',], 'sleep' => 1];
        $step[] = ['type' => 'findElement',   'do' => ['option' => 'click', 'xpath' => '//div[@title="产品中心" and @classpre="site"]',], 'sleep' => 1];
        $step[] = ['type' => 'findElement',   'do' => ['option' => 'click', 'xpath' => '//div[@title="产品中心" and @classpre="channel"]',], 'sleep' => 1];

        foreach ($navs as $key => $nav) {
            $step[] = ['type' => 'findElement',   'do' => ['option' => 'click', 'cssSelector' => 'div[title="' . $nav . '"]',]];
            $step[] = ['type' => 'findElement',   'do' => ['option' => 'click', 'cssSelector' => 'div[title="' . $nav . '"]  a',]];
        }

        $step[] =  ['type' => 'frame', 'do' => ['option' => 'outframe',], 'sleep' => 3];
        $step[] =  ['type' => 'frame', 'do' => ['option' => 'inframe', 'xpath' => '/html/body/div[8]/div[2]/div[3]/iframe'], 'sleep' => 1];


        return $step;
    }
    static function checkIsset($info)
    {
        return [
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[1]/div/div[3]/div/div/table/tbody/tr/td[1]/input', 'option' => 'click'],],
            [
                'title' => '搜索物料编码',
                'type' => 'findElement', 'do' => [
                    'xpath' => '/html/body/div[1]/div[1]/div[1]/div/div[3]/div/div/table/tbody/tr/td[1]/input',
                    'option' => ['sendKeys' => $info['itemCodeAlias'],]
                ],
                'sleep' => 1
            ],
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[1]/div/div[3]/div/div/table/tbody/tr/td[2]/div', 'option' => 'click'], 'sleep' => 3],

            [
                'title' => '判断物料编码是否存在',
                'type' => 'checkIsset',
                'do' =>  [
                    'xpath' => '/html/body/div[1]/div[1]/div[2]/div[1]/table/tbody[2]/tr/td',
                    'func' => 'checkAttrClassName',
                    'true' => static::editPage(),
                    'false' => static::addPage(),
                ],
                'sleep' => '3'
            ],

        ];
    }

    static function checkUpdateIsset($info)
    {
        return [
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[1]/div/div[4]/div/div/table/tbody/tr/td[1]/input', 'option' => 'click'],],
            [                                           // /html/body/div[1]/div[1]/div[1]/div/div[4]/div/div/table/tbody/tr/td[1]/input
                'title' => '搜索物料编码',
                'type' => 'findElement', 'do' => [
                    'xpath' => '/html/body/div[1]/div[1]/div[1]/div/div[4]/div/div/table/tbody/tr/td[1]/input',
                    'option' => ['sendKeys' => $info['itemCodeAlias'],]
                ],
                'sleep' => 1
            ],
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[1]/div/div[4]/div/div/table/tbody/tr/td[2]/div', 'option' => 'click'], 'sleep' => 3],

            //点击进入创建商品页面
            ['title' => '打开编辑窗口', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[2]/div[1]/table/tbody[2]/tr/td[3]/a', 'option' => 'click']],
            // 
            ['type' => 'window', 'do' => ['option' => 'toWindow', 'value' => 1], 'sleep' => 3],

        ];
    }
    /**
     * 判断商品是否上架
     */
    static function checkIssetUp($info)
    {
        return [
            [
                'title' => '判断物料编码是否存在',
                'type' => 'checkIsset',
                'do' =>  [
                    'xpath' => '/html/body/div[1]/div[1]/div[2]/div[1]/table/tbody[2]/tr/td',
                    'func' => 'checkIssetUp',
                    'true' => static::editPage(),
                    'false' => static::addPage(),
                ],
                'sleep' => '3'
            ],

        ];
    }
    static function checkPushOk($info)
    {
        return [
            ['type' => 'frame', 'do' => ['option' => 'inframe', 'xpath' => '/html/body/div[8]/div[2]/div[3]/iframe'], 'sleep' => 1],
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[1]/div/div[3]/div/div/table/tbody/tr/td[1]/input', 'option' => 'click'],],
            [
                'title' => '搜索物料编码',
                'type' => 'findElement', 'do' => [
                    'xpath' => '/html/body/div[1]/div[1]/div[1]/div/div[3]/div/div/table/tbody/tr/td[1]/input',
                    'option' => ['sendKeys' => $info['itemCodeAlias'],]
                ],
                'sleep' => 1
            ],
            ['type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[1]/div/div[3]/div/div/table/tbody/tr/td[2]/div', 'option' => 'click'], 'sleep' => 3],

            [
                'title' => '判断物料编码是否存在',
                'type' => 'checkIsset',
                'do' =>  [
                    'xpath' => '/html/body/div[1]/div[1]/div[2]/div[1]/table/tbody[2]/tr/td',
                    'func' => 'checkAttrClassName',
                    'true' => [
                        ['type' => 'class', 'do' => ['className' =>  'app\yperp\model\GoodsSkuStandby', 'func' => 'status', 'args' => [$info['id'], 2]], 'sleep' => 3],
                        ['type' => 'log', 'do' => '操作成功', 'sleep' => 3],
                    ],
                    'false' => [
                        ['type' => 'log', 'do' => '操作失败', 'sleep' => 3],
                        ['type' => 'class', 'do' => ['className' =>  'app\yperp\model\GoodsSkuStandby', 'func' => 'status', 'args' => [$info['id'], 1]], 'sleep' => 3],


                    ]
                ],
                'sleep' => '3'
            ],

        ];
    }
    static public function addPage()
    {
        return [
            //点击进入创建商品页面
            ['title' => '打开添加窗口', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[2]/div[1]/div[2]/div[1]/div/div[1]/div/div[2]', 'option' => 'click']],
            ['type' => 'window', 'do' => ['option' => 'toWindow', 'value' => 1], 'sleep' => 3],
        ];
    }


    static public function editPage()
    {
        return [
            //点击进入创建商品页面
            ['title' => '打开编辑窗口', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[2]/div[1]/table/tbody[2]/tr/td[2]/span', 'option' => 'click']],
            // /html/body/div[1]/div[1]/div[2]/div[1]/table/tbody[2]/tr/td[3]/a
            ['type' => 'window', 'do' => ['option' => 'toWindow', 'value' => 1], 'sleep' => 3],
        ];
    }


    static public function editUpdatePage()
    {
        return [
            //点击进入创建商品页面
            ['title' => '打开编辑窗口', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[2]/div[1]/table/tbody[2]/tr/td[3]/a', 'option' => 'click']],
            // 
            ['type' => 'window', 'do' => ['option' => 'toWindow', 'value' => 1], 'sleep' => 3],
        ];
    }
    /**
     * 编辑上架商品页面
     *
     */
    static public function UpeditPage()
    {
        return [
            //点击进入创建商品页面
            ['title' => '打开编辑窗口', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[1]/div[1]/div[2]/div[1]/table/tbody[2]/tr/td[2]/span', 'option' => 'click']],

            ['type' => 'window', 'do' => ['option' => 'toWindow', 'value' => 1], 'sleep' => 3],
        ];
    }
    static function status($info)
    {
        return [
            ['type' => 'class', 'do' => ['className' =>  'app\yperp\model\GoodsSkuStandby', 'func' => 'status', 'args' => [$info['id'], 2]], 'sleep' => 3],
            // ['title' => '修改数据状态', 'type' => 'command', 'do' => ['argument' =>  'php think yperp:mgtstatus ' . $info['id'] . ' 2'], 'sleep' => 3],

        ];
    }


    static public function saveDataTest($array = [])
    {
        return [
            //图片管理
            ['title' => '切换tab 图片管理', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/ul/li[11]/a', 'option' => 'click',], 'sleep' => 3],
            ['type' => 'frame', 'do' => ['option' => 'inframe', 'xpath'  => '/html/body/form/div/div/div[11]/div/div/div/iframe']],
            [
                'title' => '显示上传按钮', 'type' => 'findElement', 'do' => [
                    'xpath' => '/html/body/div[4]/div[1]/div/input[2]',
                    'option' => ['script' => "arguments[0].setAttribute('style', 'display: block;')",],
                ], 'sleep' => 3
            ],
            //商品头图
            [
                'title' => '上传商品头图', 'type' => 'findElement', 'do' => [
                    'xpath' => '/html/body/div[4]/div[1]/div/input[2]',
                    'option' => [
                        'uploadFiles' => $array['header_imgs']
                    ],
                ], 'sleep' => 3
            ],
            // /html/body/div[4]/div[2]/div/div[1]/div[3]/span[3]

            ['type' => 'window', 'do' => ['option' => 'toWindow', 'value' => 1], 'sleep' => 3],
        ];
    }

    static public function saveGoodsHeaderImgs($array = [])
    {
        $setp = [];

        //图片管理
        $setp[] = ['title' => '切换tab 图片管理', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/ul/li[11]/a', 'option' => 'click',], 'sleep' => 3];
        $setp[] = ['type' => 'frame', 'do' => ['option' => 'inframe', 'xpath'  => '/html/body/form/div/div/div[11]/div/div/div/iframe']];
        $setp[] = [
            'title' => '显示上传按钮', 'type' => 'findElement', 'do' => [
                'xpath' => '/html/body/div[4]/div[1]/div/input[2]',
                'option' => ['script' => "arguments[0].setAttribute('style', 'display: block;')",],
            ], 'sleep' => 3
        ];
        //  /html/body/div[4]/div[2]/div
        $setp[] =
            [
                'title' => '根据数量执行操作步骤',
                'type' => 'checkNumberDo',
                'do' =>  [
                    'xpath' => '/html/body/div[4]/div[2]/div',
                    'func' => 'checkElementNumber',
                    'setps' => [
                        // /html/body/div[4]/div[2]/div/div[1]/div[3]/span[3]

                        ['title' => '删除商品头图', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[4]/div[2]/div/div[1]/div[3]/span[3]', 'option' => 'click']],
                    ],

                ],
                'sleep' => 2
            ];
        //商品头图
        foreach ($array['header_imgs'] as $header_imgs) {
            # code...

            $setp[] =   [
                'title' => '上传商品头图', 'type' => 'findElement', 'do' => [
                    'xpath' => '/html/body/div[4]/div[1]/div/input[2]',
                    'option' => [
                        'clear' => 'clear',
                        'uploadFiles' => [str_replace('/\s+/', '', $header_imgs)],
                    ],
                ], 'sleep' => 1
            ];
        }
        $setp[] =  ['type' => 'window', 'do' => ['option' => 'toWindow', 'value' => 1], 'sleep' => 3];
        return $setp;
    }

    static public function saveGoodsBodyImgs($array = [])
    {
        $setp = [];
        //产品特征
        $setp[] =   ['title' => '切换tab 产品特征', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/ul/li[8]/a', 'option' => 'click',], 'sleep' => 3];
        $setp[] = ['type' => 'frame', 'do' => ['option' => 'inframe', 'xpath'  => '/html/body/form/div/div/div[8]/div/div/div/iframe']];
        $setp[] =   ['type' => 'frame', 'do' => ['option' => 'inframe', 'xpath'  => '/html/body/iframe[7]']];


        $setp[] =    ['title' => '点击代码按钮', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[2]/div[3]/div[1]', 'option' => 'click',], 'sleep' => 3];

        $setp[] =   ['title' => '清空代码', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/textarea', 'option' => ['clear' => 'clear'],], 'sleep' => 3];
        $setp[] =    ['title' => '点击设计按钮', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[2]/div[3]/div[2]', 'option' => 'click',], 'sleep' => 3];


        $setp[] =   ['title' => '点击多图上传打开新窗口', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[2]/div[1]/table/tbody/tr[2]/td[3]/table[1]/tbody/tr/td[23]/div', 'option' => 'click',], 'sleep' => 1];
        $setp[] =    ['type' => 'window', 'do' => ['option' => 'toWindow', 'value' => 2], 'sleep' => 3];

        $setp[] =  [
            'title' => '显示详情图上传按钮', 'type' => 'findElement', 'do' => [
                'xpath' => '/html/body/div[2]/div[3]/div/input',
                'option' => ['script' => "arguments[0].setAttribute('style', 'display: block;')",],
            ], 'sleep' => 3
        ];

        //商品详情图
        foreach ($array['body_imgs'] as $body_img) {

            $setp[] =  [
                'title' => '上传商品详情图', 'type' => 'findElement', 'do' => [
                    'xpath' => '/html/body/div[2]/div[3]/div/input',
                    'option' => [
                        'clear' => 'clear',
                        'uploadFiles' => [str_replace('/\s+/', '', $body_img)],
                    ],
                ],
            ];
        }
        $setp[] =  ['title' => '确认上传', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/div[4]/div[1]', 'option' => 'click',], 'sleep' => 3];

        $setp[] =  ['type' => 'window', 'do' => ['option' => 'toWindow', 'value' => 1], 'sleep' => 3];

        return $setp;
    }

    static function saveGoodsMainImgs($array)
    {
        return [
            //商品头图
            [
                'title' => '判断主图是否存在',
                'type' => 'checkIsset',
                'do' =>  [
                    'xpath' => '/html/body/form/div/div/div[1]/div[2]/div[3]/div/form/div[4]',
                    'func' => 'IssetMainImages',
                    'true' => [
                        ['title' => '删除已经存在的商品头图', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/div[2]/div[3]/div/form/div[4]/div/span[2]', 'option' => 'click']],
                    ],
                ],
                'sleep' => '3'
            ],

            // 如果 /html/body/form/div/div/div[1]/div[2]/div[3]/div/form/div[4] 中有两个值，那么将删除后重新再上传
            ['title' => '新增商品头图', 'type' => 'findElement', 'do' => [
                'xpath' => '/html/body/form/div/div/div[1]/div[2]/div[3]/div/form/div[1]/input',
                'option' => ['sendKeys' => $array['main_img']]
            ], 'sleep' => 3],
        ];
    }

    static public function  closeWindow()
    {
        return [

            //保存并关闭
            ['title' => '保存并关闭', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[13]/button[1]',  'option' => 'click',], 'sleep' => 2],


            ['title' => '关闭提示确认', 'type' => 'findElement', 'error' => ['option' => 'closeWindow',], 'do' => ['xpath' => '/html/body/div/div[2]/div/div/table/tbody/tr[2]/td/div/div/div/a',  'option' => 'click',], 'sleep' => 2],


            // ['title' => '关闭窗口', 'type' => 'findElement', 'do' => ['xpath' => ' /html/body/form/div/div/div[13]/button[3]',  'option' => 'click',], 'sleep' => 2],
            ['title' => '关闭窗口', 'type' => 'window', 'do' => ['option' => 'closeWindow', 'value' => 1], 'sleep' => 3],

            ['title' => '回到主窗口', 'type' => 'window', 'do' => ['option' => 'toWindow', 'value' => 0], 'sleep' => 3],

            // ['title' => '关闭窗口', 'type' => 'window', 'do' => ['option' => 'closeWindow', 'value' => 0], 'sleep' => 3],
        ];
    }

    static public function saveData($info = [])
    {
        if (!isset($info['weight'])) {
            $info['weight'] = '8';
        }
        if (!isset($info['weight_unit'])) {
            $info['weight_unit'] = 1;
        }

        return [
            //物料编码
            ['title' => '物料编码', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/div[1]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys'  => $info['itemCodeAlias']],], 'sleep' => 3],

            //供应商名称
            ['title' => '供应商名称', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/div[5]/div[3]/div', 'option' => 'click']],

            ['title' => '供应商名称', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/div[5]/div[3]/div/div/ul/li[3]', 'option' => 'click']],

            //物料描述
            ['title' => '物料描述', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/div[6]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys' => $info['itemNameAlias'] . '|' . $info['colourAlias'],]],],

            //产品简称
            ['title' => '产品简称', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/div[7]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys' => $info['itemNameAlias'] . '|' . $info['colourAlias']],],],

            //品牌
            ['title' => '品牌', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/div[8]/div[3]/select', 'option' => 'select', 'type' => 'index', 'value' => (isset($info['brand']) ? $info['brand'] : 4),],],

            //产品品牌
            ['title' => '产品品牌', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/div[9]/div[3]/select', 'option' => 'select', 'type' => 'index', 'value' => (isset($info['goods_brand']) ? $info['goods_brand'] : 4),],],

            //产品组
            ['title' => '产品组', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/div[10]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys' => '其他',]],],


            //产品线
            ['title' => '产品线', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/div[11]/div[3]/div', 'option' => 'click']],
            ['title' => '产品线', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/div[11]/div[3]/div/div/ul/li[32]', 'option' => 'click']],


            //产品名称
            ['title' => '产品名称', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/fieldset[1]/div[1]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys' =>  $info['itemNameAlias'] . '|' . $info['colourAlias']],],],

            //重量单位
            ['title' => '重量单位', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/fieldset[2]/div[1]/div[3]/select', 'option' => 'select', 'type' => 'index', 'value' => $info['weight_unit'],],],

            //计量单位
            ['title' => '计量单位', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/fieldset[2]/div[2]/div[3]/select', 'option' => 'select', 'type' => 'index', 'value' => $info['weight_unit']],],

            //最小计量单位数量
            ['title' => '最小计量单位数量', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/fieldset[2]/div[3]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys' => $info['weight']],],],

            //外包装尺寸（厚）
            ['title' => '外包装尺寸（厚）', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/fieldset[2]/div[4]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys' => $info['weight']],],],

            //外包装尺寸(高)
            ['title' => '外包装尺寸(高)', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/fieldset[2]/div[5]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys' => $info['weight']],],],

            //外包装尺寸(宽)
            ['title' => '外包装尺寸(宽)', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[1]/fieldset[2]/div[6]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys' => $info['weight']],],],



            //切换tab OFC专用区
            ['title' => '切换tab OFC专用区', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/ul/li[2]/a', 'option' => 'click',]],

            //货号
            ['title' => '货号', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[2]/div[1]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys' =>  $info['itemCodeAlias']]],],


            //条形码
            ['title' => '条形码', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[2]/div[2]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys' =>  $info['itemCodeAlias']]],],


            //税务编码
            ['title' => '税务编码', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[2]/div[3]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys' =>  $info['itemCodeAlias']]],],

            //堆放层数
            ['title' => '堆放层数', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[2]/div[4]/div[3]/span/input', 'option' => ['clear' => 'clear', 'sendKeys' => '1',]],],

            //是否为代销
            ['title' => '是否为代销', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[2]/div[5]/div[3]/div/div[1]/input', 'option' => 'click',]],

            //切换tab 其他
            ['title' => '切换tab 其他', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/ul/li[12]/a', 'option' => 'click',]],

            //产品销售渠道
            ['title' => '产品销售渠道', 'type' => 'findElement', 'do' => ['xpath' => '/html/body/form/div/div/div[12]/div[1]/div[3]/select', 'option' => 'select', 'type' => 'index', 'value' => 1,],],

        ];
    }
}
